﻿/// <reference path="/Scripts/jquery-1.5.1.min.js">
/// <reference path="/Scripts/jquery.validate.js">
/// <reference path="/Scripts/jquery.validate.unobtrusive.js">

$.validator.unobtrusive.adapters.addSingleVal("validatefileformat", "fileformat");
$.validator.addMethod("validatefileformat", function (value, element, format) {	
	if (value)
	{
		var arr = value.split('.');
		var filef = arr[arr.length - 1];
		if (format.indexOf(filef) < 0)
		{
			return false;
		}		
	}
	return true;
})

